package com.nlp.visualization.service.weibo.main;

import com.nlp.visualization.core.seg.SegmentFactory;
import com.nlp.visualization.core.seg.SegmentType;
import com.nlp.visualization.core.seg.filter.SegFilter;
import com.nlp.visualization.service.weibo.IWeiboSegService;
import com.nlp.visualization.service.weibo.WeiboSegServiceImpl;

import java.io.File;

public class Main_2 {

    public static void main(String[] args) {

        File temp_20171019 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/needParse/20171019_sw_temp.json");
        File temp_20180109 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/needParse/20180109_sw_temp.json");
        File temp_20171120 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/needParse/20171120_sw_temp.json");

        File sql_20171019 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/result/20171019_theme.sql");
        File sql_20180109 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/result/20180109_theme.sql");
        File sql_20171120 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/result/20171120 _theme.sql");

        File txt_20171019 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/result/20171019_txt.txt");
        File txt_20180109 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/result/20180109_txt.txt");
        File txt_20171120 = new File("/Volumes/Seagate Backup Plus Drive/TeacherWang_weibo_data/result/20171120 _txt.txt");

        Main_2 main_2 = new Main_2();
        main_2.seg2txt(temp_20180109, txt_20180109);

    }

    private void seg2txt(File in, File out) {

        IWeiboSegService segService = new WeiboSegServiceImpl();
        SegFilter.FilterBuilder builder2 = new SegFilter.FilterBuilder();
        builder2.enablePunctuation(true)
                .enableStopwords(true);
        SegFilter filter_sw = builder2.build();
        segService.seg2PlainText(in, out, SegmentType.HANLP_NLP, filter_sw);
    }
}
